-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing delay instruction to fake backends #8003
Conversation
This commit adds the delay instruction to the target for fake backends based on BackendV2. With BackendV2 and the Target delay isn't assumed to be present on every backend and it has to be explictly listed. This commit fixes this so that the compiler is aware that delay is a valid operation (without any additional constraints) on the BackendV2 based fake backends.
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the the following people are requested to review this:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me too!
If any instructions available in a target are ideal, with no qubits or properties set, the target class assumes the backend is ideal (like in the case of an ideal simulator where are all instructions are globally defined and have no error or duration). To avoid this we need to define the Delay instruction on all qubits explicitly. This commit makes this change to ensure the target for backends still shows the qubits and properties for the other operations. However, in adding an instruction with no properties defined a bug in the plot gate error map function was uncovered where it errored because it assumes all instructions have properties defined, this was fixed at the same time.
Pull Request Test Coverage Report for Build 2266493094
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a bug in 0.20 that needs a release note, or are we good without it?
It is arguably a bug in 0.20.0, I was on the fence on whether to backport it or not. I'll add a release note to document it though, that was an oversight. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, I always forget that pulse
defines a bunch of objects with the same names as things in circuit
.
* Add missing delay instruction to fake backends This commit adds the delay instruction to the target for fake backends based on BackendV2. With BackendV2 and the Target delay isn't assumed to be present on every backend and it has to be explictly listed. This commit fixes this so that the compiler is aware that delay is a valid operation (without any additional constraints) on the BackendV2 based fake backends. * Add qubits to Delay target entry If any instructions available in a target are ideal, with no qubits or properties set, the target class assumes the backend is ideal (like in the case of an ideal simulator where are all instructions are globally defined and have no error or duration). To avoid this we need to define the Delay instruction on all qubits explicitly. This commit makes this change to ensure the target for backends still shows the qubits and properties for the other operations. However, in adding an instruction with no properties defined a bug in the plot gate error map function was uncovered where it errored because it assumes all instructions have properties defined, this was fixed at the same time. * Add release note * Update releasenotes/notes/delay-fake-backends-3f68c074e85d531f.yaml Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Summary
This commit adds the delay instruction to the target for fake backends
based on BackendV2. With BackendV2 and the Target delay isn't assumed to
be present on every backend and it has to be explictly listed. This
commit fixes this so that the compiler is aware that delay is a valid
operation (without any additional constraints) on the BackendV2 based
fake backends.
Details and comments